NAND flash memory, as well as other types of non-volatile memories (“NVMs”), are commonly used for mass storage. For example, consumer electronics such as portable media players often include flash memory to store music, videos, and other media.
Systems having an NVM can sometimes encrypt data stored in the NVM using one or more media keys. The encrypted data may later be read through a decryption process using the same media keys. During system upgrades, encrypted data may need to be relocated to a different location in the NVM in order to free up space. Because the system may not have access to the media keys during this process, encrypted data cannot easily be relocated.
Although the system can attempt to relocate the encrypted data using no keys, some system implementations will automatically provide default keys during no-key accesses. Moreover, usage of these default keys during relocation can cause data corruption.